//
//  DMInterstitialScenes.m
//  DualMediationSDK
//
//  Created by YeJary on 2025/1/15.
//

#import "DMInterstitialScenes.h"

#pragma mark - 场景常量定义

// 内置自动触发场景
NSString * const SCENE_INTER_LEVEL_RETRY = @"SCENE_INTER_LEVEL_RETRY";
NSString * const SCENE_INTER_PLAY_TIME = @"SCENE_INTER_PLAY_TIME";
NSString * const SCENE_INTER_LEVEL_WAIT = @"SCENE_INTER_LEVEL_WAIT";

// 手动调用场景
NSString * const SCENE_INTER_LEVEL_WIN = @"SCENE_INTER_LEVEL_WIN";
NSString * const SCENE_INTER_LEVEL_FAIL = @"SCENE_INTER_LEVEL_FAIL";

// 其他场景
NSString * const SCENE_SPLASH_COOL = @"SCENE_SPLASH_COOL";
NSString * const SCENE_SPLASH_HOT = @"SCENE_SPLASH_HOT";
NSString * const SCENE_NATIVE_SETTLEMENT = @"SCENE_NATIVE_SETTLEMENT";

@implementation DMInterstitialScenes

+ (BOOL)isBuiltInScene:(NSString *)scene {
    if (!scene) return NO;
    
    NSArray *builtInScenes = @[
        SCENE_INTER_LEVEL_RETRY,
        SCENE_INTER_PLAY_TIME,
        SCENE_INTER_LEVEL_WAIT
    ];
    
    return [builtInScenes containsObject:scene];
}

+ (BOOL)isInterceptableScene:(NSString *)scene {
    if (!scene) return NO;
    
    // 目前只有SCENE_INTER_LEVEL_WAIT场景支持拦截
    return [scene isEqualToString:SCENE_INTER_LEVEL_WAIT];
}

+ (NSArray<NSString *> *)allInterstitialScenes {
    return @[
        SCENE_INTER_LEVEL_RETRY,
        SCENE_INTER_PLAY_TIME,
        SCENE_INTER_LEVEL_WAIT,
        SCENE_INTER_LEVEL_WIN,
        SCENE_INTER_LEVEL_FAIL
    ];
}

+ (DMInterstitialScene)sceneEnumFromString:(NSString *)sceneString {
    if ([sceneString isEqualToString:SCENE_INTER_LEVEL_WIN]) {
        return DMInterstitialSceneLevelWin;
    } else if ([sceneString isEqualToString:SCENE_INTER_LEVEL_FAIL]) {
        return DMInterstitialSceneLevelFail;
    } else if ([sceneString isEqualToString:SCENE_INTER_LEVEL_RETRY]) {
        return DMInterstitialSceneLevelRetry;
    } else if ([sceneString isEqualToString:SCENE_INTER_LEVEL_WAIT]) {
        return DMInterstitialSceneLevelWait;
    } else {
        // 默认返回关卡胜利场景
        return DMInterstitialSceneLevelWin;
    }
}

@end